@extends('admin.main')
@section('content')
    <div class="daohang">
        <ul>
            <li>
                <button type="button" class="am-btn am-btn-default am-radius am-btn-xs"> 科室管理</button>
            </li>
            <li>
                <button type="button" class="am-btn am-btn-default am-radius am-btn-xs"> 编辑科室</button>
            </li>
        </ul>
    </div>
    <div class="admin-biaogelist">

        <div class="listbiaoti am-cf">
            <ul> 编辑科室</ul>
        </div>

        <div class="fbneirong">
            <form class="am-form" method="post">
                <div class="am-g am-margin-top">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        科室名称
                    </div>
                    <div class="am-u-sm-8 am-u-md-4">
                        <input type="text"  name="name" class="am-input-sm" value="{{$res['name']}}">
                    </div>
                    <div class="am-hide-sm-only am-u-md-6">*必填，不可重复</div>
                </div>
                <div class="am-g am-margin-top">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">关联his科室</div>
                    <div class="am-u-sm-8 am-u-md-10">
                        <select name="reffer_id" data-am-selected="{btnSize: 'sm'}">
                            @if($departs)
                                @foreach($departs as $v)
                                    <option @if($res['reffer_id'] == $v['BCK01']) selected @endif value="{{$v['BCK01']}}">{{$v['BCK03']}}</option>
                                @endforeach
                            @endif
                        </select>
                    </div>
                </div>
                <div class="am-g am-margin-top">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        排序
                    </div>
                    <div class="am-u-sm-8 am-u-md-4">
                        <input type="text" name="sort" class="am-input-sm" value="{{$res['sort']}}">
                    </div>
                    <div class="am-hide-sm-only am-u-md-6">数字越小越靠前</div>
                </div>
                <div class="am-form-group am-cf">
                    <div class="you" style="margin-left: 11%;">
                        <input type="hidden" name="id" value="{{$res['id']}}">
                        <button type="submit" class="am-btn am-btn-success am-radius">保存</button>
                    </div>
                </div>
            </form>
        </div>
       @include('admin.footer')
    </div>
    @section('script')
        <script>
            var message = "{{Session::get('message')}}";
            $(window).ready(function () {
                if (message) {
                    layer.msg(message, {
                        time: 3000 //2秒关闭（如果不配置，默认是3秒）
                    });
                }
            });
        </script>
    @endsection
@endsection